﻿using NAudio.Wave;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AppMesPlc
{
    internal class AudioPlayer
    {
        public static void PlayMp3(string filePath)
        {
            using (var mp3Stream = new Mp3FileReader(filePath))
            using (var waveOut = new WaveOutEvent())
            {
                waveOut.Init(mp3Stream);
                waveOut.Play();
                while (waveOut.PlaybackState == PlaybackState.Playing)
                {
                    System.Threading.Thread.Sleep(100);
                }
            }
        }
    }
}
